package com.bg8loo.amateur.handler;

import org.springframework.http.HttpStatus;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.NoHandlerFoundException;

@ControllerAdvice
public class HandleException {



// 代码内遇到问题回显问题 static/warm.html
    @ExceptionHandler(value =Exception.class)
    public String exceptionHandling(Model model, Exception e){
        model.addAttribute("msg","异常问题为："+e.getMessage());
//        System.out.println("1111");
//        log.info(e.getMessage());
        return "warm";
    }






}
